#ifndef _SGF_MAP_FACTORY_H_
#define _SGF_MAP_FACTORY_H_

#include <map>

namespace SGF
{
	class MapState;
	class Game;

	class SGF_API MapFactoryBase
	{
	public:
		MapFactoryBase(Game* game);
		virtual ~MapFactoryBase();

		MapState* createMapFromFile(const char* file);
		MapState* createBlankMap(const char* sceneType);
		void saveMapToFile(MapState* map,const char* file);
	private:
		virtual MapState* newMap()=0;
		Game* game;
		std::map<Ogre::String,Ogre::SceneType> sceneManagerDictionary;
	};

	template<typename T=MapState>
	class MapFactory : public MapFactoryBase
	{
	public:
		MapFactory(Game* game)
		:MapFactoryBase(game)
		{
		}
	private:
		virtual MapState* newMap()
		{
			return new T;
		}
	};
}

#endif